home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 016a / 4doscd.zip / CD.TXT < prev   
Text File  |  1991-11-25  |  9KB  |  214 lines

  1. File CD.TXT - Version 3.0 Released 11/25/91 - Mike Bessy 75300,1215
  2. ------------------------------------------------------------------
  3.  
  4. PURPOSE:
  5.  
  6. This file outlines a disk navigation system for 4DOS users.
  7.  
  8. REQUIREMENTS:
  9.  
  10.  ■ 4DOS version 4.0 or later.
  11.  ■ at least 512 bytes of free alias space.
  12.  ■ at least 128 bytes of free environment space.
  13.  ■ MS-DOS external program FIND or equivalent.
  14.  
  15. LEGALITIES:
  16.  
  17.  4DOS is a shareware product of J.P. Software, Inc., PO Box 1470, East
  18.  Arlington, MA 02174 (617-646-3975).
  19.  
  20.  This file is offered as an example of 4DOS shell programming and a
  21.  demonstration of the power of 4DOS, and may be freely distributed as
  22.  long as no fee is charged and its contents are not altered without JP
  23.  Software's consent.
  24.  
  25.  No guarantee is made that the information in this file is correct, and
  26.  that the various components will work as expected, even though they are
  27.  constantly in use on my personal system.
  28.  
  29. LIMITATIONS:
  30.  
  31. Many of the "bells & whistles" may be overkill for many users, and might
  32. prove to be too slow or too inconvenient for slower or floppy-only
  33. machines.  This file is meant to give users a starting point from which
  34. to build a system which meets their specific needs.
  35.  
  36. HIGHLIGHTS:
  37.  
  38.     ■  CD {directory name} goes to that directory
  39.     ■  CD {string} goes to the first occurrence of 'string' in the DIR
  40.        file
  41.     ■  CD by itself returns to the previous current directory - if
  42.        the search string is not found, CD beeps and echoes the current
  43.        directory
  44.     ■  GO (or G) by itself displays all the occurrences of the last
  45.        search string in a "popup windows" for easy selection
  46.     ■  GO (or G) {string} is equivalent to CD 
  47.     ■  Additional keywords may be added manually to the DIR file, as in: 
  48.        "d:\path\foo  bar here" 
  49.     ■  The file names and locations are merely examples, and should be 
  50.        modified to reflect _your_ specific  configuration.
  51.  
  52. COMPONENTS:
  53.  
  54.     ■  optional REFRESH.BTM batch file to automatically create the ASCII
  55.        list of directories.  The DIR file can also be easily created and
  56.        maintained with any ASCII editor.
  57.  
  58.     ■  aliases in a format suitable for inclusion into a file to be
  59.        loaded at boot time with the "alias /r" command.
  60.  
  61. USAGE:
  62.  
  63.   ■  Load the enclosed CDD and GO aliases.
  64.   ■  Create an ASCII file containing the name of all the directories on
  65.      your system.  If you prefer, you can use the enclosed file
  66.      "REFRESH.BTM" to get things started.  Feel free to add, after each
  67.      directory name, any keywords you may want to use later to go to that
  68.      directory, such as:
  69.          "d:\path\xtalk\xts   scripts crosstalk"
  70.      "d:\path\123         lotus wk1
  71.  
  72.   ■  To change directories, type CD followed by a valid directory name,
  73.      if you know it, or any partial name, eg. "CD DOC".
  74.   ■  If the requested directory exists, 4DOS will take you there. If
  75.      not, you will go to the first match found on the string you provided,
  76.      eg. "C:\COMM\CSERVE\DOC".
  77.   ■  If the directory was not the one you wanted, you can type "GO", or
  78.      "G" to "pop up" a selection window with a list of all possible matches.
  79.      Use the conventional window navigation keys to select the drive and
  80.      directory you want and press ENTER to go there.  To cancel without
  81.      changing directory, hit ESCAPE.
  82.   ■  If GO is invoked with an argument, it will behave exactly like CD.
  83.  
  84.   ■  The search algorithm allows you to type "CD keyword", eg. "CD CIM" to
  85.      go to the directory paired with that keyword in the DIR file
  86.      ("C:\COMM\CSERVE\DOC" in the previous example)
  87.   ■  Either CD or GO can include other command to be executed after going to
  88.      the new directory.  Anything after the first argument will be
  89.      processed as a command.  For example, "g pc list *.log" will go to
  90.      whatever drive and directory contains the string "pc" in its name or as
  91.      a keyword in the DIR file ("d:\comm\procomm\pc", perhaps), and will
  92.      list any file with the "log" extension there.
  93.  
  94.   ■  Make sure you use a consistent name for the directory file.  The
  95.      example assumes "c:\4dos40\cdd.ini", but it can be anything you want, 
  96.      as long as REFRESH.BTM and aliases "CD*D" and "G*O" use the same file 
  97.      name.
  98.   ■  This scheme assumes that your directory structure is fairly static.  If 
  99.      you often create many new directories,  you may want to modify MD and 
  100.      RD so that they automatically maintain the  directory file.  
  101.      The possible enhancements are too numerous to detail here.  Please 
  102.      *experiment*!
  103.  
  104. REFRESH.BTM:
  105.  
  106.    Notes:
  107.  
  108.   ■  The logic assumes that you're using drive letters in alphabetical order
  109.      starting with the boot drive and ending with the drive defined as "last
  110.      drive" by DOS and reported by 4DOS in the "_lastdisk" variable.  If
  111.      your configuration differs, you may have to modify the file.
  112.  
  113.   ■  If you invoke REFRESH.BTM with an argument( eg. "refresh c", it will
  114.      assume it's a drive letter and will only process that drive, appending
  115.      to any existing DIR.  It is recommended that only non-removable
  116.      partitions be listed.
  117.  
  118.   ■  You _must_ change the DIR file name to something suitable for your
  119.      system.  REFRESH will _not_create a directory for you, and you will
  120.      have to modify the "set _f" line.
  121.  
  122.  :------ cut everything above this line to create REFRESH.BTM -----
  123.  @echo off
  124.  setlocal
  125.  *set _f=C:\$DOS40\CDD.INI
  126.  *echo ` `
  127.  iff exist %_f then
  128.    *echo %@upper[%0] will add to existing file "%_f".
  129.  else
  130.    *echo %@upper[%0] will create directory file "%_f".
  131.  endiff
  132.  *echo ` `
  133.  *echos Hit CTRL-C to Abort now, or` ` ^ pause
  134.  *set i=%1
  135.  if "%i"=="" *set i=%@char[%@ascii[%@upper[%_boot]]]
  136.  :0
  137.  iff exist %i:\nul. then
  138.    *echo Processing drive %@upper[%i]
  139.    *cdd %i:\^global/iq *echo %_cwd>>! %_f
  140.  else
  141.    *echo Invalid drive: %i
  142.    quit
  143.  endiff
  144.  *set i=%@char[%@eval[%@ascii[%i]+1]]
  145.  if %i le %@upper[%_lastdisk] .and. "%1"=="" goto 0
  146.  : ------ cut everything below this line to create REFRESH.BTM -----
  147.  
  148. ALIASES:
  149.  
  150.    Notes:
  151.  
  152.    ■  Each alias should be entered on a single line, but is broken down
  153.       here for added legibility
  154.  
  155.    ■  It is assumed that the default case is in effect and that the
  156.       contents of the DIR file will be in lower case.  If the DIR file is
  157.       in upper case, replace "%@lower" with %@upper" in the CDD alias.
  158.  
  159.    ■  The path for FIND should be adjusted for your system.  Giving a full
  160.       path speeds up execution significantly on many machines.
  161.  
  162.    ■  A small temporary work file will be created in the root directory of 
  163.       your "TEMP" drive, or of the current drive is TEMP is not defined. If
  164.       TEMP is defined, its contents are expected to contain a drive letter 
  165.       and colon, followed by an optional path, but no trailing backslash
  166.       ("c:", "d:\temp", etc.). 
  167.  
  168.    ■  Alias "~d" is an integral part of the CDD processing and should NOT
  169.       be used by itself.
  170.  
  171. ;---- add the lines below to your "ALIAS /R" file ----------
  172.  
  173.   CD*D=*set _cdd=%1^if "%1"=="" *set _cdd=%_cd^iff not isdir
  174.          %_cdd\. then^find "%@lower[%1]"<c:\4dos40\cdd.ini|input %%_cdd^
  175.          endiff^~d %&
  176.  
  177.   G*O=iff "%1"=="" then^find "%_go" c:\4dos40\cdd.ini|find /v "--">!%temp\_go^
  178.          *cdd %@word[0,%@select[%temp\_go,2,40,15,79,■ Go where?  ■ ]]^
  179.          *del /q %temp\_go^else^cdd %1^endiff
  180.  
  181.  
  182.   ~D=iff "%_cdd"=="" then^beep^echo %_cwd^else^*set _cd=%_cwd^*set _go=%1^
  183.          *cdd %_cdd^%2&^endiff^*set _cdd=
  184.  
  185. ; the following GX alias is a bonus for having made it this far into the
  186.   file.  It will "popup" a selection windows containing all the subdirectories
  187.   in your current working directory.  Select the one you want (including
  188.   ".." for the parent directory) by using the usual navigation keys, and
  189.   pressing ENTER, or hit ESCAPE to cancel.  Like CD and GO, GX also
  190.   accepts additional commands to be executed in the destination directory.
  191.  
  192.   GX=*dir/kmad>!%temp\_gx^*cdd %@word[0,%@select[%temp\_gx,2,60,15,73,
  193.                                 ■ Subdirectories ■]]>&nul^*del/q %temp\_gx
  194.  
  195. ;-----cut everything below this line -----------------------
  196.  
  197. HISTORY:
  198.  
  199.  1.0  02-25-91 Initially posted on CompuServe
  200.  1.1  02-28-91 Corrected REFRESH.BTM to search all drives
  201.                Corrected UM alias
  202.                Eliminated the CDD Syntax error message on invalid searches
  203.  1.2  03-28-91 Eliminated variable _CD
  204.  2.0  06-03-91 Greatly simplified - dropped MARKS and added ability to
  205.            add commands to the CD line
  206.  2.1  06-25-91 Replaced the missing GO alias
  207.  3.0  11-25-91 Rewritten to use the 4DOS 4.0 features
  208.  
  209. SUPPORT:
  210.  
  211. Please post all questions and comments as public messages in the JP
  212. Software Support Section ("GO JPSOFT", Section 10).  Feel free to ask for
  213. clarification of any feature (or bug!)
  214.